package com.lxw.filesystem.controller;

import com.lxw.api.filesystem.FileSystemControllerApi;
import com.lxw.filesystem.service.FilesystemService;
import com.lxw.framework.domain.filesystem.response.UploadFileResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;
/**

 */
@RestController
@RequestMapping("/filesystem")
public class FilesystemController implements FileSystemControllerApi {

    @Autowired
    private FilesystemService filesystemService;
    @Override
    @PostMapping("/upload")
    public UploadFileResult upload(@RequestParam("file") MultipartFile multipartFile, String businesskey, String filetag, Map metadata) {
        return filesystemService.upload(multipartFile,businesskey,filetag,metadata);
    }
}
